home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / var / lib / dpkg / info / libsane.postinst < prev    next >
Text File  |  2008-05-07  |  2KB  |  76 lines

  1. #!/bin/sh -e
  2.  
  3. purge_devfs() {
  4.     if [ -f "/etc/devfs/conf.d/scanner" ] ; then
  5.     rm -f /etc/devfs/conf.d/scanner
  6.     rmdir --parents --ignore-fail-on-non-empty /etc/devfs/
  7.     fi
  8. }
  9.  
  10. purge_hotplug() {
  11.     if [ -f "/etc/hotplug/usb/libsane.usermap" ] ; then
  12.     rm -f /etc/hotplug/usb/libsane.usermap
  13.     fi
  14.     if [ -f "/etc/hotplug/usb/libusbscanner" ] ; then
  15.     rm -f /etc/hotplug/usb/libusbscanner
  16.     fi
  17. }
  18.  
  19. purge_hotplugng() {
  20.     if [ -f "/etc/hotplug.d/usb/libsane.hotplug" ]; then
  21.     rm -f /etc/hotplug.d/usb/libsane.hotplug
  22.     rmdir -p --ignore-fail-on-non-empty /etc/hotplug.d/usb
  23.     fi
  24.  
  25.     if [ -f "/etc/hotplug/blacklist.d/libsane" ]; then
  26.     rm -f /etc/hotplug/blacklist.d/libsane
  27.     rmdir -p --ignore-fail-on-non-empty /etc/hotplug/blacklist.d
  28.     fi
  29.  
  30.     if [ -f "/etc/sane.d/hotplug/libsane.db" ]; then
  31.     rm -f /etc/sane.d/hotplug/libsane.db
  32.     rmdir -p --ignore-fail-on-non-empty /etc/sane.d/hotplug
  33.     fi
  34. }
  35.  
  36. case "$1" in
  37.     configure)
  38.  
  39.     if [ "$(uname -s)" = "Linux" ]; then
  40.     # remove devfs config as scanning through usbscanner is not supported anymore
  41.     purge_devfs
  42.     # remove old hotplug scripts
  43.     purge_hotplug
  44.     # remove old hotplug-ng scripts
  45.     purge_hotplugng
  46.  
  47.     if [ -e /dev/MAKEDEV ]; then
  48.         # create /dev/parport*
  49.         if [ ! -c /dev/parport0 ]; then
  50.         (cd /dev && ./MAKEDEV parport) || true 
  51.         fi
  52.         # create /dev/sg*
  53.         if [ ! -c /dev/sg0 ]; then
  54.         (cd /dev && ./MAKEDEV sg) || true 
  55.         fi
  56.     fi
  57.     fi
  58.     ;;
  59.  
  60.     abort-upgrade|abort-remove|abort-deconfigure)
  61.     ;;
  62.  
  63.     *)
  64.     echo "$0 called with unknown argument '$1'" >&2
  65.     exit 1
  66.     ;;
  67. esac
  68.  
  69.  
  70. # Automatically added by dh_makeshlibs
  71. if [ "$1" = "configure" ]; then
  72.     ldconfig
  73. fi
  74. # End automatically added section
  75.  
  76.